

package com.zhanghuan.scheduler.job.dao;


import com.zhanghuan.scheduler.job.entity.ScheduleJobEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


/**
 * 定时任务
 *
 */

public interface ScheduleJobDao extends JpaRepository<ScheduleJobEntity,String> {
    //分页按照beanName查找
    @Query(value="select * from schedule_job where bean_name like concat('%',?1,'%') limit ?2,?3",nativeQuery=true)
    List<ScheduleJobEntity> findAllByBeanNameLike(String beanName,int offset,int limit);
    //返回beanName查找的记录数
    long countAllByBeanNameLike(String beanName);
}
